package com.hooview.api.controller;

import com.hooview.api.entity.Banner;
import com.hooview.api.service.BannerService;
import com.hooview.common.utils.AjaxMsg;
import com.hooview.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * banner表
 *
 * @author lee
 * @email 
 * @date 2018-01-19 09:34:44
 */
@RestController
public class BannerController {
	@Autowired
	private BannerService bannerService;

	/**
	 * 列表
	 */
	@RequestMapping("/api/banner/list")
	public AjaxMsg list(@RequestParam Map<String, Object> params){
		AjaxMsg ajaxMsg=new AjaxMsg();
		List<Banner> bannerList = bannerService.queryList(params);
		ajaxMsg.setDatas(bannerList);
		ajaxMsg.setCode(AjaxMsg.SUCCESS);
		return ajaxMsg;
	}
}
